package request;

import core.GameCharacter;
import core.GameUser;
import java.io.OutputStream;
//import java.util.Vector;

import response.ResponseBuddies;

/**
 * Request that handles "buddy request" from user.
 * "Buddy" request means user wants to get the list of all his or her buddies.
 *
 * @author Zoran
 *
 */
public class RequestBuddies extends GameRequest{

    private GameUser user;
    private GameCharacter character;

    // Username passed in.
    private String username = null;
    // User Id of the user requesting list of buddies.
    private int userId;
    // List of user's buddies.
    //Vector<String> buddyList;
    String buddies;

    public void parse() {
        buddies = gameServer.getBuddies(client.getUser().getCharacter().getID());
    }

	public void respond(OutputStream output) {
		// Generate response with buddy list
		ResponseBuddies response = new ResponseBuddies();
		response.set(gameServer);
		response.setBuddies(buddies);
		response.setOut(output);
		response.run();
	}
}